package com.hl.card.modular.packBack.controller;

import com.alibaba.fastjson.JSONObject;
import com.hl.card.common.controller.BaseController;
import com.hl.card.common.util.CommonUtil;
import com.hl.card.common.util.ResponseData;
import com.hl.card.modular.pack.service.UserDataService;
import com.hl.card.modular.packBack.service.VipManageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;


/**
 * 会员管理前端控制
 * 
 * @author zhouyongbang
 * @Date 2018-06-12 14:37:08
 */

@Controller
/*@RequestMapping("/api/vipManage")*/
@RequestMapping("/vipManage")
public class VipManageController extends BaseController {
 
	@Autowired
	private ResponseData responseData;
	
	@Autowired
	private VipManageService vipManageService;
	
	@Autowired
	private UserDataService userDataService;
	
	private String PREFIX = "/packback/vipManage/";
	
	/**
     * 会员管理主页
     */
    @RequestMapping("")
    public String index(){
        return PREFIX+"vipManage.html";
    }

    @RequestMapping("/queryVipManage")
	@ResponseBody
	public Object queryfreezingManage(String userId,Integer start,Integer end,String createTime, String userName ,String ismember,String loginAccount ,String remainPart,String freezePart) {
		responseData.setData(null);
		if (CommonUtil.isEmpty(start)) {
			responseData.setStatus("0");
			responseData.setMsg("不能为空");
			return responseData;
		}
		if(end==null||"".equals(end))
		{
			end=1;
		}
		 JSONObject responseData= vipManageService.queryVipManage(userId,start,end,createTime,userName,loginAccount,remainPart,ismember,freezePart);
		 System.out.println(responseData.get("list"));
		return responseData.get("list");
	}
	
}

